<?php

namespace App\Providers;

use App\Services\WeChat\TemplateFactory;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
        $this->app->singleton('wechat.message', function ($app) {
            return new \App\Services\WeChat\MessageDispatcher();
        });
        $this->app->singleton(TemplateFactory::class, function ($app) {
            return new TemplateFactory($app->make('wechat.message'));
        });
    }

    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        //
        \Schema::defaultStringLength(191);

    }
}
